package DAO;

import POJO.Testdata;
import Util.DataAccessUtil;
import java.util.List;

/**
 *
 * @author Nguyen Hong Phu (1142066) - 11HCB (HCMUS)
 */
public class TestDataDAO {
    public static List<Testdata> getListTestData(int limitStart, int records) throws Exception{
        String hql = "SELECT p FROM Testdata p";
        return DataAccessUtil.getList(hql,limitStart,records);
    }
    public static long getTotalList() throws Exception{
        String hql = "SELECT count(p) FROM Testdata p";
        Object result = DataAccessUtil.getUniqueResult(hql);
        if(result==null)
            return 0;
        return (long) result;
    }
}
